using net_work.Common.Request;
using net_work.Common.Result;
using net_work.Data.DTO.Appr;
using net_work.Data.Entity.Appr;
using net_work.Data.VO.Appr;

namespace net_work.IRepository.Appr;

public interface IApprovalInstanceRepository: IRepository<ApprovalInstance>
{
    /// <summary>
    /// 插入审批申请
    /// </summary>
    /// <returns>审批申请ID</returns>
    Task<long> InsertAsync(ApprovalInstanceAddRequest approvalInstanceAddRequest);

    /// <summary>
    /// 更新审批申请信息
    /// </summary>
    /// <returns>是否成功</returns>
    Task<bool> UpdateAsync(ApprovalInstanceUpdateRequest approvalInstanceUpdateRequest);

    /// <summary>
    /// 获取审批申请列表
    /// </summary>
    /// <param name="pagedRequest">分页请求</param>
    /// <returns>分页结果</returns>
    Task<PagedResult<ApprovalInstanceWithHistoryResult>> GetListAsync(PagedRequest pagedRequest);

    /// <summary>
    /// 获取待办事项列表
    /// </summary>
    /// <param name="pagedRequest">分页请求</param>
    /// <returns>分页结果</returns>
    Task<PagedResult<ApprovalInstanceToDoResult>> GetToDoListAsync(PagedRequest pagedRequest);

    /// <summary>
    /// 审批跳转
    /// </summary>
    /// <param name="approvalInstanceId">审批申请ID</param>
    /// <param name="skipResult">跳转方向</param>
    /// <returns>是否成功</returns>
    Task<bool> Skip(long approvalInstanceId, bool skipResult);
}